my $prompt = '[\u@\h \W]\\\$';

# make the prompt red on production machines
$prompt = '\[\033[01;31m\]'.$prompt.'\[\033[0m\]'
    if fetch_val('production');

text_install("/etc/profile.d/rollout.sh", <<EOF, -mode => 0755);
[ -n "\$PS1" ] && PS1="$prompt "
[ -z "\$EDITOR" ] && EDITOR=vim
[ -z "\$PAGER" ] && PAGER=less
[ "X\$TERM" = Xxterm-debian ] && TERM=xterm
[ "X\$TERM" = Xrxvt ] && stty erase ^H
export PS1 EDITOR PAGER TERM
EOF

file_append("/etc/vimrc", <<EOVIMRC, sub { /^augroup gpg/../^augroup END/ });
augroup gpg
au!
au BufReadPre,FileReadPre *.gpg set viminfo=
au BufReadPre,FileReadPre *.gpg set noswapfile
au BufReadPost *.gpg :%!gpg -q -d
au BufReadPost *.gpg | redraw
au BufWritePre *.gpg :%!gpg --default-recipient-self -q -e -a
au BufWritePost *.gpg u
au VimLeave *.gpg :!clear
augroup END
EOVIMRC

# make vim use dark green for comments, rather than unreadable dark blue
file_append("/etc/vimrc", <<EOVIMRC, qr/^highlight comment /);
highlight comment ctermfg=darkgreen
highlight comment guifg=darkgreen
EOVIMRC

# make bash highlight directories in yellow, rather than unreadable dark blue
file_append("/etc/DIR_COLORS", "DIR 01;33\t# directory\n", qr/^DIR /);

file_install("/usr/bin/$_", "$ROLLOUT/scripts/viw", -mode => 0755)
    foreach qw(vis viw);

1;
